package com.chatplus.application.domain.model.account;

import com.chatplus.application.common.domain.model.UserAccount;
import com.chatplus.application.json.Int64AsString;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.io.Serializable;

/**
 * @author weird
 */
public class MerchantInfo implements Serializable {
    private static final long serialVersionUID = -4694380885291443941L;
    /**
     * 商家Id,t_account表的id;用于关联t_account表
     */
    @JsonSerialize(using = Int64AsString.class)
    private Long merchantId;

    /**
     * 联系电话
     */
    private String contactPhone;
    /**
     * 头像图片地址
     */
    private String avatarUrl;

    public static MerchantInfo fromUserAccount(UserAccount userAccount) {
        MerchantInfo merchantInfo = new MerchantInfo();
        merchantInfo.setMerchantId(userAccount.getId());
        merchantInfo.setAvatarUrl(userAccount.getAvatarUrl());
        merchantInfo.setContactPhone(userAccount.getContactPhone());
        return merchantInfo;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public String getAvatarUrl() {
        return avatarUrl;
    }

    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }
}
